//
//  ReplaceDriveTableViewCell.m
//  JxCarios
//
//  Created by xcq on 15/1/29.
//  Copyright (c) 2015年 xiongchuanqi. All rights reserved.
//

#import "ReplaceDriveTableViewCell.h"
#import "CLUIBaseViewController.h"

@implementation ReplaceDriveTableViewCell

- (void)awakeFromNib {
//    if ([self respondsToSelector:@selector(setSeparatorInset:)]) {
//        [self setSeparatorInset:UIEdgeInsetsMake(0, 0, 0, 8)];
//    }
//    
//    if ([self respondsToSelector:@selector(setLayoutMargins:)]) {
//        [self setLayoutMargins:UIEdgeInsetsMake(0, 0, 0, 8)];
//    }
//    if([self respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){
//        
//        [self setPreservesSuperviewLayoutMargins:NO];
//        
//    }
}


- (void)setInfo:(NSDictionary *)info{
    if ([info objectForKey:@"SHOP_LOGO"] != [NSNull null]) {
            [_djPhoto setImageWithURL:[NSURL URLWithString:[info objectForKey:@"SHOP_LOGO"]] placeholderImage:nil options:SDWebImageProgressiveDownload ];
    }
    
    _djPhoto.layer.cornerRadius = 5.0f;
    _djPhoto.layer.masksToBounds = YES;
    _djName.text = [info customObjectForkey:@"SHOP_NAME"] != [NSNull null] ? [info customObjectForkey:@"SHOP_NAME"] : @"";
    _dianzanLabel.text = [info customObjectForkey:@"GOOD_NUM"];
    if ([[info customObjectForkey:@"MINPRICE"] isEqualToString:@""]) {
        _price.hidden = YES;
    }else {
        _price.text = [RMB stringByAppendingString:[info customObjectForkey:@"MINPRICE"]];
    }
    CGFloat distance = [[info objectForKey:@"SFZ"] doubleValue] / 1000;
     _djDistance.text = [[NSString stringWithFormat:@"%.1f",distance] stringByAppendingString:@"km"];

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
